/*
 * Controller form Klant crud functionality
 */

define([
	"dojo", 
	"dojo/_base/xhr",
	"dojox/xml/parser",
	"dojo/topic"
],
    
function(
	dojo, 
	xhr, 
	xmlParser,
	topic )
{
	var Services = {

		getGpx : function(aUrl) {
			console.log('getting gpx...')
			xhr.get({
				url : aUrl,
				//handleAs : "xml",
				load : function(data) {
					var dom = dojox.xml.parser.parse(data);
					topic.publish("GPX_RETRIEVED", dom);
				},
				error : function(error) {
					console.log("*** fout in getting gpx " + error);
				}
			})
		}
	}

	return Services;

});
